package com.lightmusic.auth.security.details.userdetails.member;

// import jdk.nashorn.internal.runtime.GlobalConstants;
import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;

/**
 * 用户认证信息
 * @author lzc
 */
@Data
public class MemberUserDetails implements UserDetails {


    private Long memberId;
    private String username;
    private Boolean enabled;

    /**
     * 扩展字段：认证身份标识，枚举值如下：
     *
     * @see com.lightmusic.common.enums.AuthenticationIdentityEnum
     */
    private String authenticationIdentity;

    /**
     * 小程序会员用户体系
     *
     * @param member 小程序会员用户认证信息
     */
//    public MemberUserDetails(MemberAuthInfoDTO member) {
//        this.setMemberId(member.getMemberId());
//        this.setUsername(member.getUsername());
//        this.setEnabled(GlobalConstants.STATUS_YES.equals(member.getStatus()));
//    }

    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return null;
    }

    @Override
    public String getPassword() {
        return null;
    }

    @Override
    public String getUsername() {
        return null;
    }

    @Override
    public boolean isAccountNonExpired() {
        return false;
    }

    @Override
    public boolean isAccountNonLocked() {
        return false;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return false;
    }

    @Override
    public boolean isEnabled() {
        return false;
    }
}
